//
//  StringWithHeight.m
//  Lesson_UI_09自适应高度
//
//  Created by dllo on 15/8/13.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "StringWithHeight.h"

@implementation StringWithHeight

+(CGFloat)HeightWithText:(NSString *)text width:(CGFloat)winth font:(UIFont *)font
{
    CGSize size = CGSizeMake(winth, 3000);
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
    return  rect.size.height;
    
    
}

@end
